<?php
class Main_Controller_Plugin_Router extends Zend_Controller_Plugin_Abstract
{
	/**
	 * (non-PHPdoc)
	 * @see library/Zend/Controller/Plugin/Zend_Controller_Plugin_Abstract#routeStartup()
	 */ 
    public function routeStartup(Zend_Controller_Request_Abstract $request)
    {
    	$requestUri = $request->getRequestUri();
    	$serviceUrl = Main_Const::getSeriveUrlStr();
    	if (mb_substr_count($requestUri, $serviceUrl)) {
    		return;
    	}
    	if (mb_substr_count($requestUri, '/admin/')) {
    		return;
    	}
    	
    	$route = new Zend_Controller_Router_Route_Regex(
        	'(.*)',
            array(
            	'module'		=> 'default',
            	'controller'    => 'index',
                'action'        => 'show',
            )
        );
    	
        /*$route = new Zend_Controller_Router_Route(
        	':page/*',
            array(
            	'module'		=> 'default',
            	'controller'    => 'index',
                'action'        => 'show',
            )
        );*/
        Zend_Controller_Front::getInstance()->getRouter()->addRoute('page', $route);
    }

    
}